<%@page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>创业武汉合伙人</title>
    <%@include file="common/header.jsp"%>
</head>
<body>
<!-- page 容器 -->
<div class="page" data-router="true">
    <!-- 标题栏 -->
    <header class="bar bar-nav bgcolor nobottom">
        <button class="button button-link button-nav whitecolor pull-left" href="${ctx}/m/index.do">
            <span class="icon icon-left"></span>

        </button>
        <%@include file="common/headerPic.jsp" %>
        <h1 class="title whitecolor">我承办的活动</h1>
    </header>

    <!-- 这里是页面内容区 -->
    <div class="content whitebg infinite-scroll" data-distance="100">
        <div class="buttons-tab">
            <a href="#tab1" class="tab-link active button">待审核</a>
            <a href="#tab2" id="tab2Link" class="tab-link button">已通过</a>
            <a href="#tab3" id="tab3Link" class="tab-link button">已驳回</a>
        </div>

        <div class="tabs">
            <div id="tab1" class="tab active graycolor">
                <%--<div class="message">已搜索到${activityPager.totalCount}场活动</div>--%>
                <div class="contentList" data-totalPage="1" data-pageNum="1">
                    <div class="live">
                        <a class="toDetail" href="">
                            <div class="live-left"><img class="mainPicUrl lazy" src="images/empty.png"
                                                        data-original="${Dict.prefix('UPLOAD')}${activity.mainPicUrl}">
                            </div>
                            <div class="live-center">
                                <div class="row_nowrap cyzjTitle"></div>
                                <div class="row_nowrap little_size cyzjGuest"></div>
                                <div class="row_nowrap little_size dwName">承办单位：</div>
                                <div class="row_nowrap little_size cyzjStartTime">开始时间：</div>
                            </div>
                            <a class="live-right living processStatus">活动状态</a>
                        </a>
                    </div>
                </div>
                <!-- preloader -->
                <div class="infinite-scroll-preloader">
                    <div class="preloader"></div>
                </div>
            </div>

            <div id="tab2" class="tab graycolor">
                <div class="contentList" data-totalPage="1" data-pageNum="1">
                    <div class="live">
                        <a class="toDetail" href="">
                            <div class="live-left"><img class="mainPicUrl lazy" src="images/empty.png"
                                                        data-original="${Dict.prefix('UPLOAD')}${activity.mainPicUrl}">
                            </div>
                            <div class="live-center">
                                <div class="row_nowrap cyzjTitle"></div>
                                <div class="row_nowrap little_size cyzjGuest"></div>
                                <div class="row_nowrap little_size dwName">承办单位：</div>
                                <div class="row_nowrap little_size cyzjStartTime">开始时间：</div>
                            </div>
                            <a class="live-right living processStatus">活动状态</a>
                        </a>
                    </div>
                </div>
                <!-- preloader -->
                <div class="infinite-scroll-preloader">
                    <div class="preloader"></div>
                </div>
            </div>

            <div id="tab3" class="tab graycolor">
                <div class="contentList" data-totalPage="1" data-pageNum="1">
                    <div class="live">
                        <a class="toDetail" href="">
                            <div class="live-left"><img class="mainPicUrl lazy" src="images/empty.png"
                                                        data-original="${Dict.prefix('UPLOAD')}${activity.mainPicUrl}">
                            </div>
                            <div class="live-center">
                                <div class="row_nowrap cyzjTitle"></div>
                                <div class="row_nowrap little_size cyzjGuest"></div>
                                <div class="row_nowrap little_size dwName">承办单位：</div>
                                <div class="row_nowrap little_size cyzjStartTime">开始时间：</div>
                            </div>
                            <a class="live-right living processStatus">活动状态</a>
                        </a>
                    </div>
                </div>
                <!-- preloader -->
                <div class="infinite-scroll-preloader">
                    <div class="preloader"></div>
                </div>
            </div>

        </div>
    </div>
</div>

<%@include file="common/panel.jsp" %>
</body>
</html>
<%@include file="common/footer.jsp" %>
<%@include file="common/nav_header_new.jsp" %>
<script>


    $.init();
    initTab();

    var objBase = $(".tab.active  .contentList > .live").eq(0).clone();
    var contentList = $(".contentList");
    contentList.empty();

    var loading = false;
    function addItems(data, content) {
        $.each(data.resultList, function () {
            var obj = objBase.clone();
            obj.find(".cyzjTitle").text(getAlias('ACTIVITY_TYPE',this.activityType) + " | " + this.activityName);
            obj.find(".dwName").text("承办单位：" + this.dwName);
            if (this.guestNames =='' || this.guestNames == null || this.guestName=='null') {

            }else{
                obj.find(".cyzjGuest").text("嘉宾：" + this.guestNames);
            }
            obj.find(".cyzjStartTime").text("开始时间：" + (new Date(this.beginTime)).Format("yyyy-MM-dd hh:mm"));
            obj.find(".processStatus").text(getAlias('PROCESS_STATUS',this.processStatus));
            obj.find(".toDetail").attr("href", "${ctx}/m/activityDetail.do?id=" + this.id);
            obj.find(".mainPicUrl").attr("data-original", "${Dict.prefix('UPLOAD')}" + this.mainPicUrl);
            content.append(obj);
        });
        var pageNum = parseInt(content.attr("data-pageNum")) + 1;
        content.attr("data-pageNum", pageNum);
        lazyLoad();
    }

    function queryUrl() {
        var isTab1 = $("#tab1").hasClass("active");
        var isTab2 = $("#tab2").hasClass("active");
        if(isTab1) {
            return "${ctx}/m/activityPager.do?map.approveStatus=SUBMITED&map.user_I=master";
        }else if(isTab2){
            return "${ctx}/m/activityPager.do?map.approveStatus=APPROVED&map.user_I=master";
        }else{
            return "${ctx}/m/activityPager.do?map.approveStatus=REJECTED&map.user_I=master";
        }

    }

    contentList = $(".tab.active .contentList");
    ajaxTODO(null, contentList, true);

</script>